home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 5 / chrpro3.zip / MCONFILE.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  5KB  |  177 lines

  1. * Program MCONFILE - allows direct display/editing of the CONTRIB file.
  2.      ? 'Select:  1) Display CONTRIB file records '
  3.      ? '         2) Edit CONTRIB records for a particular week '
  4. Accept '         3) Enter PLEDGED amounts for contributors     ' to XX
  5. ?
  6. Do while @(xx,'123Qq')=0
  7.   Accept 'Invalid entry. Please enter again ' to xx
  8. enddo
  9. Do CASE
  10. CASE XX='2'
  11. Select primary
  12. Store d+':contrib' to mfile
  13. Use &MFILE
  14. Accept 'Enter a week number ' to ecx
  15. Store val(ecx) to wknumb
  16. Store $(curdates,wknumb*6-5,5) to wkname
  17. Store (wknumb*8)+1 to FL
  18. Store FL+9 to SS
  19. If wknummax=15
  20.   Store 122-SS to SL
  21. else
  22.   Store 50-SS to SL
  23. endif
  24. Accept 'Enter an envelope number ' to envno
  25. Do while !(envno)<>'Q'
  26.   Erase
  27.   Store val(envno) to envnumb
  28.   @ 2,20 say 'Contribution record editing for week '+wkname
  29.   If envnumb>offermax.or.envnumb<1
  30.      Accept 'Invalid envelope number. Enter again ' to envno
  31.     Store val(envno) to envnumb
  32.   endif
  33.   Store 'R' to resp
  34.   GOTO envnumb
  35.   @ 5,20 say 'Contribution Envelope: '+envno
  36.   Store 0.00 to ocategt1
  37.   Store 0.00 to ocategt2
  38.   Store 0.00 to ocategt3
  39.   Store 0.00 to ocategt4
  40.   Store 7 to NN
  41.   Store '1' to N
  42.   Do while N<>OT
  43.     Store $(ocateg&N,FL+1,8) to resp
  44.     If resp='        '
  45.       Store 0.00 to ocategt&N
  46.     else
  47.       Store &resp to ocategt&N
  48.     endif
  49.     @ NN,22 say ocatnam&N
  50.     @ NN,35 get ocategt&N
  51.     Store NN+1 to NN
  52.     Store str(val(N)+1,1) to N
  53.   enddo
  54.   @ NN,40 say '------'
  55.   Store ocategt1+ocategt2+ocategt3+ocategt4 to EC
  56.   @ NN+1,36 say ec
  57.   READ
  58.   Store 0.00 to ocategt&OT
  59.   Store ocategt1+ocategt2+ocategt3+ocategt4 to ocategt&OT
  60.   @ NN+1,36 say ocategt&OT
  61.   ?
  62.   Store '0' to N
  63.   Do while N<>OT
  64.     Store str(val(N)+1,1) to N
  65.     Replace ocateg&N with $(ocateg&N,1,FL)+str(ocategt&N,8,2)+$(ocateg&N,SS,SL)
  66.   enddo
  67.   Accept '          Enter another envelope number ("Q"=quit) ' to envno
  68.  enddo
  69. Release SS,SL,FL,wkname,envno,ocategt1,ocategt2,ocategt3,ocategt4,ecx,envnumb,N
  70. CASE XX='1'
  71.       Accept 'Enter "D" for Display or "P" for Print-out ' to XY
  72. Accept 'Enter desired envelope number to start with, or press <retn> for all' ;
  73. to xx
  74.   If !(XX)<>'Q'
  75.   Store offermax+1 to maxrec
  76.   If XX=' '
  77.     Store '1' to XX
  78.     Store ' ' to XZ
  79.   else
  80.     Store 'Y' to XZ
  81.   endif
  82.   If !(XY)='P'
  83.    ?
  84.    ? 'Now printing a direct CONTRIB file report.  Ready the printer . . . '
  85.    Set format to print
  86.    Store 66 to curline
  87.    GOTO &XX
  88.    Do while #<maxrec .and. .not. EOF
  89.     If curline>60
  90.       Eject
  91.       @ 2,20 say 'Contributions File  - -  '+curdate
  92.       Store 5 to curline
  93.     endif
  94.     @ curline,0 say str(#,4)
  95.     Store '0' to N
  96.     Do while N<>OT
  97.       Store str(val(N)+1,1) to N
  98.       @ curline,5 say OCATNAM&N+OCATEG&N
  99.       Store curline+1 to curline
  100.     enddo
  101.     Store curline+1 to curline
  102.     SKIP
  103.    enddo
  104.    Set format to screen
  105.   else
  106.    erase
  107.    @ 1,10 say 'Contributions File  - -  '+curdate
  108.    GOTO &XX
  109.    ?
  110.    Do while #<MAXREC .AND. .NOT. EOF
  111.      Store '0' to N
  112.      Do while N<>OT
  113.        Store str(val(N)+1,1) to N
  114.        ? #,OCATNAM&N,OCATEG&N
  115.      enddo
  116.      SKIP
  117.      IF !(XZ)='Y'
  118.        ACCEPT 'Continue? ' to XZ
  119.        If !(XZ)<>'Y'
  120.          Store # to maxrec
  121.        endif
  122.      endif
  123.    enddo
  124.   endif
  125.   ?
  126.   Accept 'Report is complete. Press <RETURN> ' to xx
  127.  endif
  128.  RELEASE XY,XZ
  129. CASE XX='3'
  130. Erase
  131. @ 2,20 say 'Pledged CONTRIBUTIONS Entry Routine'
  132. ?
  133. ?
  134. Store 'Enter pledged CONTRIBUTION amount for envelope number' to inpledgd
  135. Accept 'Enter starting envelope number, or press <retn> for beginning ' to XX
  136. If XX=' '
  137.   Store '1' to XX
  138. endif
  139. GOTO &XX
  140. Do while #=0 and !(XX)<>'Q'
  141.   Accept 'Envelope number not found. Please enter again ' to XX
  142. enddo
  143. If !(XX)<>'Q'
  144.   Store '   0.00' to oldcontr
  145.   Store '    0' to oldenvl
  146.   Store offermax+1 to maxoffer
  147.   Do while #<maxoffer .and. !(XX)<>'Q' .and. .not. EOF
  148.     If pledged='         '
  149.       Store 0.00 to xnum
  150.     else
  151.       Store pledged to XX
  152.       Store &XX to xnum
  153.     endif
  154.     ERASE
  155.     @ 1,20 say 'PLEDGED AMOUNTS ENTRY ROUTINE'
  156.     @ 3,40 say 'Previous Envelope'+oldenvl+' $'+oldcontr
  157.     Store str(#,4) to inenvl
  158.     @ 5,5  say inpledgd+inenvl get xnum
  159.     READ
  160.     If XNUM<0
  161.       GOTO BOTTOM
  162.     else
  163.       Store str(XNUM,9,2) to XXX
  164.       Replace pledged with XXX
  165.       Store str(#,4) to oldenvl
  166.       Store XXX to oldcontr
  167.     endif
  168.     SKIP
  169.   enddo
  170. endif
  171. ENDCASE
  172.  0.00 to ocategt1
  173.   Store 0.00 to ocategt2
  174.   Store 0.00 to ocategt3
  175.   Store 0.00 to ocategt4
  176.   Store 7 to XX
  177.   Store '1' to